package com.gitee.fastmybatis.core.query.param;

import com.gitee.fastmybatis.core.query.Query;
import com.gitee.fastmybatis.core.query.TenantQuery;

import java.io.Serializable;

/**
 * @author thc
 */
public interface IParam extends Serializable {

    /**
     * 生成Query查询对象
     * @return 返回查询对象
     */
    default Query toQuery() {
        return new Query().addAnnotionExpression(this);
    }

    /**
     * 生成TenantQuery查询对象
     * @return 返回TenantQuery
     */
    default TenantQuery toTenantQuery() {
        TenantQuery tenantQuery = new TenantQuery();
        tenantQuery.addAnnotionExpression(this);
        return tenantQuery;
    }
}
